import pymysql

class Tools:

    def __init__(self,session,hostip="114.132.200.42",hostport="81"):
        self.session = session
        self.host_url =f"http://{hostip}:{hostport}/"

    def using_mysql(self, sql_text):
        db = pymysql.connect(
            user='shop',
            password='PTrHWJeaiP',
            host='114.132.200.42',
            port=3306,
            database="shop",
            charset='utf8mb4')
        cs = db.cursor()
        cs.execute(str(sql_text))
        data = cs.fetchall()
        db.commit()
        db.close()
        return data
